package com.xiaoming.e3mall.controller;

import com.xiaoming.e3mall.common.pojo.EasyUIDataGridResult;
import com.xiaoming.e3mall.common.utils.E3Result;
import com.xiaoming.e3mall.content.service.ContentService;
import com.xiaoming.e3mall.pojo.TbContent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 前台指定区域的内容添加
 */

@Controller
@RequestMapping("/content")
public class ContentController {

    @Autowired
    private ContentService contentService;


    @RequestMapping("/save")
        @ResponseBody
    public E3Result addContent(TbContent content){
        return contentService.addContent(content);
    }


    @RequestMapping("/query/list")
        @ResponseBody
    public EasyUIDataGridResult contentList(Long categoryId, int page, int rows){

        return contentService.query(categoryId,page,rows);
    }

    @RequestMapping("/edit")
        @ResponseBody
    public E3Result editContent(TbContent content){
        return null;
    }


}
